<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>js第二次</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <title>js——BOM、DOM</title>
    <link href="https://cdn.bootcss.com/twitter-bootstrap/4.4.1/css/bootstrap.css" rel="stylesheet">
    <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="https://cdn.bootcss.com/animate.css/3.7.2/animate.min.css" rel="stylesheet">
    
</head>
<body>
    <div>
        <h1>家</h1>
        <p>是谁来自山川湖海，却囿于昼夜、厨房与爱。</p>
    </div>

    <body class="container">
        <style>
            .red {
                color: red;
            }
    
        </style>
    
        <header>
            <h1 class="text-center">js——BOM、DOM</h1>
            <h1 class="text-center">js——BOM、DOM</h1>
        </header>
        <main>
            <p>shurunjiu</p>
        </main>
        <footer></footer>
        <script src="https://cdn.bootcss.com/vue/2.6.11/vue.js"></script>
        <script>
            var results = document.getElementsByTagName('h1');
            for (const key in results) {
                console.log(key);
            }
            var classContent = results[0].className;
            results[0].className = results[0].className + ' red';
    
            var oP = document.createElement("p");
            var oText = document.createTextNode("这是一个使用 DOM 生成的段落");
            oP.appendChild(oText);
            document.body.appendChild(oP);
    
            var a = 0, b = 1;
            console.time("timer");
            for (var i = 0; i < 10000; i++) { }
            console.assert(a === 1, "这时候条件是a==1,实际a是1");
            console.assert(b === 1, "这时候条件是b==1，实际b是2"); //断言
            console.warn("这是一段警告信息");
            console.error("出错啦，你的配置信息有误");
            console.timeEnd("timer");
        </script>
    </body>
    
    </html>
    